    package com.example.blog.entity;

    import jakarta.persistence.Column;
    import jakarta.persistence.Entity;
    import jakarta.persistence.Id;
    import lombok.Data;


    @Entity(name = "article")
    public class Article {
        @Id

        @Column(name="id")
        private int id;
        @Column(name="updatetime")
        private String updatetime;
        @Column(name="likes")
        private int likes;
        @Column(name="comments")
        private int comments;
        @Column(name="user_id")
        private int user_id;
        @Column(name="content")
        private String content;
        @Column(name="title")
        private String title;
        @Column(name="username")
        private String username; // 添加发布者的用户名字段
        @Column(name="tagId")
        private String tagId;

        @Column(name="tagName")
        private String tagName;

        // 省略其他字段的 getter 和 setter 方法
        public void setUsername(String username) {
            this.username = username;
        }
        public String getUsername() {
            return username;
        }

        public void setId(int id) {
            this.id = id;
        }
        public int getId() {
            return id;
        }
        public void setComments(int comments) {
            this.comments = comments;
        }
        public int getComments() {
            return comments;
        }
        public void setLikes(int likes) {
            this.likes = likes;
        }
        public int getLikes() {
            return likes;
        }
        public void setUpdatetime(String updatetime) {
            this.updatetime = updatetime;
        }
        public String getUpdatetime() {
            return updatetime;
        }

        public void setUser_id(int user_id) {
            this.user_id = user_id;
        }

        public int getUser_id() {
            return user_id;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getContent() {
            return content;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getTitle() {
            return title;
        }
        public void setTagId(String tagId) {
            this.tagId = tagId;
        }
        public String getTagId() {
            return tagId;
        }

        public void setTagName(String tagName) {
            this.tagName = tagName;
        }
        public String getTagName() {
            return tagName;
        }
    }
